package com.woniuxy.rbac.service.impl;

import com.woniuxy.rbac.entity.Role;
import com.woniuxy.rbac.mapper.RoleMapper;
import com.woniuxy.rbac.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: 老谭（<a href="http://www.woniuxy.com">蜗牛学苑</a>）
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;

    @Override
    public void add(Role role) {
        role.setStatus(Role.ENABLE);
        roleMapper.insert(role);
    }

    @Override
    public List<Role> getAll() {
        return roleMapper.getAll();
    }
}
